﻿using System;
using DapperExtensions.Mapper;
using ZLWeb.WebApiEntityBase;

namespace ZL.CRM.CommonEntity.AccOpr.Web
{
    public class AccThrOpenYwcore : ResponseResultInfo
    {
        /// <summary>
        ///  凭证号
        /// </summary>
        public string oprcardno { get; set; }

        /// <summary>
        ///  凭证类型：2-微信appid+"|"+openid(仅线上系统使用)
        /// </summary>
        public short oprctype { get; set; }

        /// <summary>
        ///  本地业务生效时间(自然时间)
        /// </summary>
        public DateTime? oprtime { get; set; } = DateTime.Now;

        /// <summary>
        ///  发生地点id(分支机构)
        /// </summary>
        public int oprbrid { get; set; }

        /// <summary>
        ///  发生地点名称
        /// </summary>
        public string oprbrname { get; set; }

        /// <summary>
        ///  本地业务生效人id(员工id)
        /// </summary>
        public int oprid { get; set; }

        /// <summary>
        ///  本地业务生效人名称
        /// </summary>
        public string oprname { get; set; }

        /// <summary>
        ///  手机号
        /// </summary>
        public string oprcellphone { get; set; }

        /// <summary>
        ///  微信会员卡code
        /// </summary>
        public string rcode { get; set; }

        /// <summary>
        ///  微信会员卡cardid
        /// </summary>
        public string rcardid { get; set; }

        /// <summary>
        ///  微信memberno（12位动态码）（服务端生成）
        /// </summary>
        public string wxcardno { get; set; }

        /// <summary>
        ///  账户id（服务端生成）
        /// </summary>
        public long opraccid { get; set; }

        /// <summary>
        ///  CRM业务操作记录流水号（服务端生成）
        /// </summary>
        public string oprsno { get; set; }

        /// <summary>
        ///  卡种id
        /// </summary>
        public int cardgsid { get; set; }

        /// <summary>
        ///  卡种识别码
        /// </summary>
        public string cardgsidsbm { get; set; }

        /// <summary>
        ///  折扣类别id（服务端生成）
        /// </summary>
        public int carddisid { get; set; }

        /// <summary>
        ///  折扣类别识别码
        /// </summary>
        public string carddissbm { get; set; }

        /// <summary>
        ///  折扣权益失效日期
        /// </summary>
        public DateTime? carddissxrq { get; set; }

        /// <summary>
        ///  生日
        /// </summary>
        public string accbrith { get; set; }

        /// <summary>
        ///  顾客姓名
        /// </summary>
        public string acckhname { get; set; }
    }

    public class AccThrOpenYwcoreMapper : ClassMapper<AccThrOpenYwcore>
    {
        public AccThrOpenYwcoreMapper()
        {
            Table("#ywcore");
            Map(f => f.oprcardno).Column("oprcardno");
            Map(f => f.oprctype).Column("oprctype");
            Map(f => f.oprtime).Column("oprtime");
            Map(f => f.oprbrid).Column("oprbrid");
            Map(f => f.oprbrname).Column("oprbrname");
            Map(f => f.oprcellphone).Column("oprcellphone");
            Map(f => f.rcode).Column("rcode");
            Map(f => f.rcardid).Column("rcardid");
            Map(f => f.wxcardno).Column("wxcardno");
            Map(f => f.opraccid).Column("opraccid");
            Map(f => f.oprsno).Column("oprsno");
            Map(f => f.cardgsid).Column("cardgsid");
            Map(f => f.cardgsidsbm).Column("cardgsidsbm");
            Map(f => f.carddisid).Column("carddisid");
            Map(f => f.carddissbm).Column("carddissbm");
            Map(f => f.carddissxrq).Column("carddissxrq");
            Map(f => f.accbrith).Column("accbrith");
            Map(f => f.acckhname).Column("acckhname");
        }
    }
}
